<?php e($javascript->codeBlock('$(document).ready(function(){$("#the-table").tableSorter();});'));?>
<div id="user-admin">
	
	<div class="action-buttons">
		<?php e($html->link('Add New User', '/admin/users/add',array('class'=>'add')));?>
	</div>
	
	<table id="the-table">
		<caption>Users on <?php e($sitename);?></caption>
		<colgroup>
			<col id="id" />
			<col id="username" />
			<col id="email" />
			<col id="group" />
			<col id="active />"
			<col id="actions" />
		</colgroup>
		<thead>
			<tr>
				<th scope="col">User ID</th>
				<th scope="col">Username</th>
				<th scope="col">EMail</th>
				<th scope="col">Group</th>
				<th scope="col">Active?</th>
				<th scope="col">Actions</th>
			</tr>
		</thead>
		<tbody>
			<?php $row = 0; ?>
			<?php foreach ($users as $user) : ?>
			<tr class="<?php ($row % 2 ? e('even') : e('odd'));?>">
				<td><?php e($user['User']['id']);?></td>
				<td><?php e($html->link($user['User']['username'], '/profiles/view/' . $user['Profile']['id']));?></td>
				<td><?php e($user['User']['email']);?></td>
				<td><?php e($user['Group']['name']);?></td>
				<td><?php ($user['User']['active'] == 0 ? e('No') : e('Yes'));?></td>
				<td>
					<ul>
						<li><?php e($html->link('Edit', '/admin/users/edit/' . $user['User']['id'], array('class'=>'edit')));?></li>
						<li><?php e($html->link('Delete', '/admin/users/delete/' . $user['User']['id'], array('class'=>'delete'),'Are you sure you wish to delete user "' . $user['User']['username'] . '"'));?></li>
					</ul>
				</td>
			</tr>
			<?php $row++; ?>
			<?php endforeach; ?>
		</tbody>
	</table>
</div>

<div id="paginate">
	<span class="previous">
		<?php e($paginator->prev('<< Previous', null, null, array('class' => 'disabled'))); ?>
	</span>
	<span class="next">
		<?php e($paginator->next('Next >>', null, null, array('class' => 'disabled'))); ?>
	</span>
	<br style="clear" />
</div>